#!/bin/bash
#定义变量
##正常使用的用户
user1=userr
#判断当前用户是不是root
if [[ $EUID -ne 0 ]]; then
    echo "user is no root" 1>&2
	exit 1
fi
#安装sudo和archlinuxcn
pacman --noconfirm -S sudo
echo -e "\n[archlinuxcn]\nSigLevel = Optional TrustedOnly\nInclude = /etc/pacman.d/archlinuxcn\n"|sudo tee -a /etc/pacman.conf
echo -e '\nServer = https://mirrors.tuna.tsinghua.edu.cn/archlinuxcn/$arch\n'|sudo tee -a /etc/pacman.d/archlinuxcn
sudo pacman --noconfirm -Sy
sudo pacman --noconfirm -S archlinuxcn-keyring
#安装基本的图形环境
#xf86-input-synaptics 笔记本触摸板
pacman --noconfirm -S xorg-server xfce4
pacman --noconfirm -S  network-manager-applet lightdm lightdm-gtk-greeter xfce4-whiskermenu-plugin
sudo systemctl enable lightdm
#美化
##安装主题
pacman --noconfirm -S arc-gtk-theme arc-icon-theme numix-circle-icon-theme-git
#安装中文字体(思源宋体),中文输入法
#思源黑体:adobe-source-han-sans-otc-fonts 思源宋体:adobe-source-han-serif-otc-fonts
pacman --noconfirm -S adobe-source-han-sans-otc-fonts fcitx-im fcitx-configtool fcitx-rime
###配置Locale
cat >> /etc/locale.gen << EOF
en_US.UTF-8 UTF-8
zh_CN.UTF-8 UTF-8
EOF
locale-gen
echo LANG=en_US.UTF-8 > /etc/locale.conf
echo "export LANG=zh_CN.UTF-8" >> /home/$user1/.xprofile
echo "export LANGUAGE=zh_CN:en_US" >> /home/$user1/.xprofile
sudo echo -e "export GTK_IM_MODULE=fcitx\nexport QT_IM_MODULE=fcitx\nexport XMODIFIERS=@im=fcitx" >> /home/$user1/.xprofile
sudo echo "$user1 ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
echo "soft"
#常用软件安装
#Synapse 快速搜索程序
#deepin-screenshot 深度截图
#numix-circle-icon-theme-git 图标
#tilda 下拉终端
#xfce4-whiskermenu-plugin 应用程序菜单
#常用软件注释,根据自己需要安装
#物理机常用软件
#pacman --noconfirm -S yay tilda anki youtube-dl tigervnc virtualbox virtualbox-host-dkms linux-headers numix-circle-icon-theme-git deepin-screenshot ntfs-3g wget vim notepadqq  google-chrome besttrace mtr screen nmap iftop aria2 git wps-office ttf-wps-fonts smplayer iotop visual-studio-code-bin alsa-utils
